package com;

import com.beans.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * \* Created with IntelliJ IDEA.
 * \* com.beans.User: Administrator
 * \* Date: 2022/7/7
 * \* Time: 15:23
 * \* To change this template use File | Settings | File Templates.
 * \* Description:
 * \
 */
public class App {
    public static void main(String[] args) {
        //1.得到Spring上下文对象
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
        //2.加载某个bean
        User user = (User) context.getBean("user");
        //3.调用响应的Spring
        System.out.println(user.sayHi("java"));
    }
}
